package com.gec.demo.demos.web;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

//声明@Controller存储类型注解,表示SampleController类启动是,对象会加载到Spring容器
@Controller
public class SampleController {

    // 表示如果访问路径/,返回字符串Hello World!
    @RequestMapping("/")
    @ResponseBody
    String home() {
        return "Hello World!";
    }
}
